<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
    />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Per Body Gravity</title>
    <link rel="stylesheet" href="/css/examples.css?ver=1.0.0" />
    <script src="/js/examples.js?ver=1.1.1"></script>
    <script src="/lib/enable3d/enable3d.framework.0.22.0.min.js"></script>
  </head>

  <body>
    <div id="info-text">The Right Box uses a different Gravity.</div>
    <script>
      const { Project, Scene3D, PhysicsLoader } = ENABLE3D

      class MainScene extends Scene3D {
        create() {
          this.warpSpeed()

          const leftBox = this.physics.add.box({ x: -2, y: 5 })
          const rightBox = this.physics.add.box({ x: 2, y: 5 })

          rightBox.body.setGravity(0, -1, 0)
        }
      }
      PhysicsLoader('/lib/ammo/kripken', () => new Project({ scenes: [MainScene] }))
    </script>
  </body>
</html>
